<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/8/16
  Time: 14:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div class="container">
<div class="row w">
    <div class="col-xs-12 col-md-8">
        <div class="name-title">
            <a href="${pageContext.request.contextPath}/index"><img
                    src="${pageContext.request.contextPath}/img/index/Frame 9.png" alt="" srcset=""></a>
            <div class="title">
                <h1>西藏投资项目在线审批监管平台</h1>
                <p>INVESTMENT PROJECTS ONLINE APPROVAL REGULATORY PLATFORM
                </p>
            </div>
        </div>
    </div>
    <div class="col-xs-8 col-md-4">
        <div class="l_head">
            <div>
                <div class="time">
                    <div class="row">
                        <div class="time-header col-md-8 col-xs-7">
                            <span id="start"></span>
                        </div>
                        <div class="login-header col-md-4 col-xs-5">
                            <c:if test="${sessionScope.get('userInfo')!=null}">
                                <div style="position: relative;top: -11px">
                                    <div class="dropdown">
                                        <button type="button" class="btn dropdown-toggle" id="dropdownMenu1"
                                                data-toggle="dropdown">
                                            <img src="${pageContext.request.contextPath}/img/index/Frame 10.png"
                                                 style="margin-left:2%">
                                            欢迎您:${sessionScope.userInfo.getName()}
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                            <li role="presentation">
                                                <a role="menuitem" tabindex="-1" href="${pageContext.request.contextPath}/user/myHomePage">个人中心</a>
                                            </li>
                                            <li role="presentation">
                                                <a role="menuitem" tabindex="-1" href="${pageContext.request.contextPath}/user/myapplication">我的申请</a>
                                            </li>
                                            <li role="presentation">
                                                <a role="menuitem" tabindex="-1" href="${pageContext.request.contextPath}/user/modify">修改个人信息</a>
                                            </li>
                                            <c:if test="${sessionScope.get('userInfo').getRole().getId()==1}">
                                            <li role="presentation">
                                                <a role="menuitem" tabindex="-1" href="${pageContext.request.contextPath}/system/index">进入后台</a>
                                            </li>
                                            </c:if>
                                            <li role="presentation" class="divider"></li>
                                            <li role="presentation">
                                                <a role="menuitem" tabindex="-1" href="${pageContext.request.contextPath}/signOut">退出登录</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </c:if>

                            <c:if test="${sessionScope.get('userInfo')==null}">
                                <span class="btn-login">
                                    <a href="${pageContext.request.contextPath}/index#loginJump" class="log">登录</a>
                                    <a href="${pageContext.request.contextPath}/user/regist" class="res">注册</a>
                                </span>
                            </c:if>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script>
    $(function () {
        var t = null;
        t = setTimeout(time, 0);//開始运行
        function time() {
            clearTimeout(t);//清除定时器
            dt = new Date();
            var year = dt.getFullYear();
            var month = dt.getMonth() + 1;//(0-11,0代表1月)
            var date = dt.getDate();//获取天
            var num = dt.getDay();//获取星期
            var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
            var hour = dt.getHours();//获取时
            var minute = dt.getMinutes();//获取分
            var second = dt.getSeconds();//获取秒
            //分秒时间是一位数字，在数字前补0。
            date = extra(date);
            month = extra(month);
            minute = extra(minute);
            second = extra(second);
            document.getElementById("start").innerHTML = year + " 年 " + month + " 月 " + date + " 日 " + hour + "：" + minute + "：" + second + " " + weekday[num];
            t = setTimeout(time, 1000); //设定定时器，循环运行
        }

    });

    //补位函数。
    function extra(x) {
        //如果传入数字小于10，数字前补一位0。
        if (x < 10) {
            return "0" + x;
        } else {
            return x;
        }
    }
</script>